<template>
  <div id="app">
    <!--    <note-list/>-->
    <v-app>
      <router-view/>
    </v-app>
  </div>
</template>


<style>
</style>
<script>
import NoteList from "@/views/calendars/noteList";
import Login from "@/views/profile/login";

export default {
  components: {Login, NoteList},
  data() {
    return {}
  },
  methods: {
    //获取程序配置消息
    getAppContext() {
      this.$axios({
        url: '/noteList/getBaseContext',
        method: 'GET',
      }).then(response => {
        this.$store.commit("setNoteList", response.data.noteClass);
      }).catch(error => {
        this.$message.error("初始化失败....")
      })
    },
    //获取文件模板
    getEmailTemplate() {
      this.$axios({
        url: '/noteList/getEmailTemplate/10001',
        method: 'GET',
      }).then(response => {
        this.$store.commit("setEmailTemplate", response.data.noteClass);
      }).catch(error => {
        this.$message.error("初始化文件模板失败...")
      })
    },
    //获取菜单栏
    getElMenu() {
      this.$axios({
        url: '/noteList/getElMenu',
        method: 'GET',
      }).then(response => {
        let elData = response.data.noteClass;
        for (let index = 0; index < elData.length; index++) {
          this.$store.commit("setElMenuTitle" + (index + 1), elData[index]);
        }
        // console.log(response.data);
      }).catch(error => {
        this.$message.error("初始化菜单栏失败...")
      })
    }

  },
  mounted() {
    this.getAppContext();
    this.getEmailTemplate();
    this.getElMenu();
  },
  created() {
  }
}
</script>
